<template>
    <el-card shadow="never">
        <yun-table
                :columns="columns"
                style="width:800px"
                :common-search="false"
                toolbar="refresh,add,edit,del"
                :auth="{
                    add:{:$auth->check('app\\admin\\controller\\delivery\\channel\\Gird','add')},
                    edit:{:$auth->check('app\\admin\\controller\\delivery\\channel\\Gird','edit')},
                    del:{:$auth->check('app\\admin\\controller\\delivery\\channel\\Gird','del')},
                    multi:{:$auth->check('app\\admin\\controller\\delivery\\channel\\Gird','multi')},
                }"
                :extend="extend">
        </yun-table>
    </el-card>
</template>
<script>
    import table from "@components/Table.js";
    export default{
        components:{
            'YunTable':table,
        },
        data:{
            extend:{
                index_url: 'delivery/channel-gird/index',
                add_url: 'delivery/channel-gird/add',
                edit_url: 'delivery/channel-gird/edit',
                del_url: 'delivery/channel-gird/del',
                multi_url: 'delivery/channel-gird/multi',
            },
            columns:[
                {checkbox: true},
                {field:"gird_title",title:"网格名称"},
                {
                    field:"drivers",
                    title:"司机",
                    formatter:function (data,row){
                        if(!data){
                            return;
                        }
                        let tags=Yunqi.formatter.tags;
                        tags.value=data.map(res=>{
                            return res.realname;
                        });
                        return tags;
                    }
                },
                {
                    field: 'operate',
                    title: __('操作'),
                    width:130,
                    action:{
                        edit:true,
                        del:true,
                    },
                }
            ]
        }
    }
</script>
<style>

</style>
